#!/bin/sh

case "$1" in
    FAIL|TIMEOUT|leasefail)
	coproc ip_set {
		sleep 3
		ip addr add 169.254.1.$((RANDOM%256))/16 brd 169.254.255.255 dev $interface
		ip route add  via 169.254.1.1 dev $interface
	}
	exec {ip_set[0]}<&- {ip_set[1]}>&-
	killall  udhcpc
        ;;
esac

